const obj = {
  name: "yz",
  age: 18
}

console.log(Object.entries(obj));

const objEntries = Object.entries(obj)
objEntries.forEach(item => {
  console.log(item[0], item[1]);
})

console.log(Object.entries(["aaa", "bbb", "ccc"]));
console.log(Object.entries("abc"));

